const install = (Vue, vm) => {
	// 此处没有使用传入的params参数
	let getSearch = (params = {}) => vm.$u.get(hotSearchUrl, {
		id: 2
	});

	// 此处使用了传入的params参数，一切自定义即可
	let getCity = (params = {}) => vm.$u.get('/city/list', params);

	let getUserinfo = () => vm.$u.get('/member/info').then(res => {
		let user = res.data.result.member_info
		let info = res.data.result.finance
		vm.$store.commit('userLogin', user)
		vm.$store.commit('setFinance', info)
	})

	// 将各个定义的接口名称，统一放进对象挂载到vm.$u.api(因为vm就是this，也即this.$u.api)下
	vm.$u.api = {
		getCity,
		getUserinfo
	};
}

export default {
	install
}
